home *** CD-ROM | disk | FTP | other *** search
-
-
-
- eeeeddddiiiitttt((((1111)))) eeeeddddiiiitttt((((1111))))
-
-
-
- NNNNAAAAMMMMEEEE
- edit - text editor (variant of ex for casual users)
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- eeeeddddiiiitttt [----rrrr] [----xxxx] [----CCCC] _n_a_m_e ...
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _e_d_i_t is a variant of the text editor _e_x recommended for new or casual
- users who wish to use a command-oriented editor. It operates precisely
- as _e_x(1) with the following options automatically set:
-
- novice ON
- report ON
- showmode ON
- magic OFF
-
- These options can be turned on or off via the sssseeeetttt command in _e_x(1).
-
- ----rrrr Recover file after an editor or system crash.
-
- ----xxxx Encryption option; when used the file is encrypted as it is being
- written and requires an encryption key to be read. _e_d_i_t makes an
- educated guess to determine if a file is encrypted or not. See
- _c_r_y_p_t(1). Also, see the WWWWAAAARRRRNNNNIIIINNNNGGGG section at the end of this
- reference page.
-
- ----CCCC Encryption option; the same as ----xxxx except that _e_d_i_t assumes files are
- encrypted.
-
- The following brief introduction should help you get started with _e_d_i_t.
- If you are using a CRT terminal you may want to learn about the display
- editor _v_i.
-
- To edit the contents of an existing file you begin with the command eeeeddddiiiitttt
- _n_a_m_e to the shell. _e_d_i_t makes a copy of the file that you can edit and
- tells you how many lines and characters are in the file. To create a new
- file, you also begin with the command eeeeddddiiiitttt with a filename: eeeeddddiiiitttt _n_a_m_e;
- the editor tells you it is a _[[[[_NNNN_eeee_wwww _FFFF_iiii_llll_eeee_]]]].
-
- The _e_d_i_t command prompt is the colon (::::), which you should see after
- starting the editor. If you are editing an existing file, you have some
- lines in _e_d_i_t's buffer (its name for the copy of the file you are
- editing). When you start editing, _e_d_i_t makes the last line of the file
- the current line. Most commands to _e_d_i_t use the current line if you do
- not tell them which line to use. Thus if you say pppprrrriiiinnnntttt (which can be
- abbreviated pppp) and type carriage return (as you should after all _e_d_i_t
- commands), the current line is printed. If you ddddeeeelllleeeetttteeee (dddd) the current
- line, _e_d_i_t prints the new current line, which is usually the next line in
- the file. If you ddddeeeelllleeeetttteeee the last line, the new last line becomes the
- current one.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- eeeeddddiiiitttt((((1111)))) eeeeddddiiiitttt((((1111))))
-
-
-
- If you start with an empty file or wish to add some new lines, the aaaappppppppeeeennnndddd
- (aaaa) command can be used. After you execute this command (typing a
- carriage return after the word aaaappppppppeeeennnndddd), _e_d_i_t reads lines from your
- terminal until you type a line consisting of just a dot (....); it places
- these lines after the current line. The last line you type becomes the
- current line. The command iiiinnnnsssseeeerrrrtttt (iiii) is like aaaappppppppeeeennnndddd, but places the
- lines you type before, rather than after, the current line.
-
- _e_d_i_t numbers the lines in the buffer, with the first line having number
- 1. If you execute the command 1111, _e_d_i_t types the first line of the
- buffer. If you then execute the command dddd, _e_d_i_t deletes the first line,
- line 2 becomes line 1, and _e_d_i_t prints the current line (the new line 1)
- so you can see where you are. In general, the current line is always the
- last line affected by a command.
-
- You can make a change to some text within the current line by using the
- ssssuuuubbbbssssttttiiiittttuuuutttteeee (ssss) command: ssss/_o_l_d/_n_e_w/ where _o_l_d is the string of characters
- you want to replace and _n_e_w is the string of characters you want to
- replace _o_l_d with.
-
- The command ffffiiiilllleeee (ffff) tells you how many lines there are in the buffer you
- are editing and says _[[[[_MMMM_oooo_dddd_iiii_ffff_iiii_eeee_dddd_]]]] if you have changed the buffer. After
- modifying a file, you can save the contents of the file by executing a
- wwwwrrrriiiitttteeee (wwww) command. You can leave the editor by issuing a qqqquuuuiiiitttt (qqqq)
- command. If you run _e_d_i_t on a file, but do not change it, it is not
- necessary (but does no harm) to wwwwrrrriiiitttteeee the file back. If you try to qqqquuuuiiiitttt
- from _e_d_i_t after modifying the buffer without writing it out, you receive
- the message _NNNN_oooo _wwww_rrrr_iiii_tttt_eeee _ssss_iiii_nnnn_cccc_eeee _llll_aaaa_ssss_tttt _cccc_hhhh_aaaa_nnnn_gggg_eeee _((((_::::_qqqq_uuuu_iiii_tttt_!!!! _oooo_vvvv_eeee_rrrr_rrrr_iiii_dddd_eeee_ssss_)))), and _e_d_i_t waits
- for another command. If you do not want to write the buffer out, issue
- the qqqquuuuiiiitttt command followed by an exclamation point (qqqq!!!!). The buffer is
- irretrievably discarded and you return to the shell.
-
- By using the dddd and aaaa commands and giving line numbers to see lines in the
- file, you can make any changes you want. You should learn at least a few
- more things, however, if you will use _e_d_i_t more than a few times.
-
- The cccchhhhaaaannnnggggeeee (cccc) command changes the current line to a sequence of lines
- you supply (as in aaaappppppppeeeennnndddd, you type lines up to a line consisting of only
- a dot (....). You can tell cccchhhhaaaannnnggggeeee to change more than one line by giving
- the line numbers of the lines you want to change, that is, 3333,,,,5555cccc. You can
- print lines this way too: 1111,,,,22223333pppp prints the first 23 lines of the file.
-
- The uuuunnnnddddoooo (uuuu) command reverses the effect of the last command you executed
- that changed the buffer. Thus if you execute a ssssuuuubbbbssssttttiiiittttuuuutttteeee command that
- does not do what you want, type uuuu and the old contents of the line are
- restored. You can also uuuunnnnddddoooo an uuuunnnnddddoooo command. _e_d_i_t gives you a warning
- message when a command affects more than one line of the buffer. Note
- that commands such as wwwwrrrriiiitttteeee and qqqquuuuiiiitttt cannot be undone.
-
- To look at the next line in the buffer, type carriage return. To look at
- a number of lines, type ^^^^DDDD (while holding down the control key, press dddd)
- rather than carriage return. This shows you a half-screen of lines on a
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- eeeeddddiiiitttt((((1111)))) eeeeddddiiiitttt((((1111))))
-
-
-
- CRT or 12 lines on a hardcopy terminal. You can look at nearby text by
- executing the zzzz command. The current line appears in the middle of the
- text displayed, and the last line displayed becomes the current line; you
- can get back to the line where you were before you executed the zzzz command
- by typing ''''''''. The zzzz command has other options: zzzz---- prints a screen of
- text (or 24 lines) ending where you are; zzzz++++ prints the next screenful.
- If you want less than a screenful of lines, type zzzz....11111111 to display five
- lines before and five lines after the current line. (Typing zzzz...._n, when _n
- is an odd number, displays a total of _n lines, centered about the current
- line; when _n is an even number, it displays _n-1 lines, so that the lines
- displayed are centered around the current line.) You can give counts
- after other commands; for example, you can delete 5 lines starting with
- the current line with the command dddd5555 ....
-
- To find things in the file, you can use line numbers if you happen to
- know them; since the line numbers change when you insert and delete lines
- this is somewhat unreliable. You can search backwards and forwards in
- the file for strings by giving commands of the form /_t_e_x_t/ to search
- forward for _t_e_x_t or ?_t_e_x_t? to search backward for _t_e_x_t . If a search
- reaches the end of the file without finding _t_e_x_t, it wraps around and
- continues to search back to the line where you are. A useful feature
- here is a search of the form /^_t_e_x_t/ which searches for _t_e_x_t at the
- beginning of a line. Similarly /_t_e_x_t$/ searches for _t_e_x_t at the end of a
- line. You can leave off the trailing //// or ???? in these commands.
-
- The current line has the symbolic name dot (....); this is most useful in a
- range of lines as in ....,,,,$$$$pppp which prints the current line plus the rest of
- the lines in the file. To move to the last line in the file, you can
- refer to it by its symbolic name $. Thus the command $$$$dddd deletes the last
- line in the file, no matter what the current line is. Arithmetic with
- line references is also possible. Thus the line $$$$----5555 is the fifth before
- the last and ....++++22220000 is 20 lines after the current line.
-
- You can find out the current line by typing ....====. This is useful if you
- wish to move or copy a section of text within a file or between files.
- Find the first and last line numbers you wish to copy or move. To move
- lines 10 through 20, type 11110000,,,,22220000dddd aaaa to delete these lines from the file
- and place them in a buffer named aaaa. _e_d_i_t has 26 such buffers named aaaa
- through zzzz. To put the contents of buffer aaaa after the current line, type
- ppppuuuutttt aaaa. If you want to move or copy these lines to another file, execute
- an eeeeddddiiiitttt (eeee) command after copying the lines; following the eeee command with
- the name of the other file you wish to edit, that is, eeeeddddiiiitttt cccchhhhaaaapppptttteeeerrrr2222. To
- copy lines without deleting them, use yyyyaaaannnnkkkk (yyyy) in place of dddd. If the
- text you wish to move or copy is all within one file, it is not necessary
- to use named buffers. For example, to move lines 10 through 20 to the
- end of the file, type 11110000,,,,22220000mmmm $$$$.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- ed(1), ex(1), vi(1).
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-